// pages/camel_card/my_camelCard_details/index.js
var app = getApp();
Page({

  /**
   * 页面的初始数据
   */
  data: {
  
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    console.log(options.user_id);
    var that = this;
    // wx.request({
    //   url: '',
    //   data: '',
    //   header: {},
    //   success: function (res) {

    //伪数据
    var lists = [
      { title: '赠送', time: '2018-01-08 08:02:32', money: '+100.00', },
      { title: '充值', time: '2018-01-08 08:02:32', money: '+100.00', },
      { title: '消费', time: '2018-01-08 08:02:32', money: '-200.00', },
    ];

   wx.request({
                url: app.url + 'api_account/account_log_list',
                data: {
                },
                header: {
                    'content-type': 'application/json',
                    'token': wx.getStorageSync('token_key')
                }, success: function (json) {
                  console.log(json)
                  if(json.data.done==false){
                     prompt(json.data.message, 'loading', true);
                  }else{
                     that.setData({ lists: json.data.result,})
                  }
                }
            })



 that.setData({ lists: lists,})
   


  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {
  console.log('用户下拉了');
  },
})